package com.powerunion.datacollection.dao;

import java.sql.Connection;
import java.util.List;

import net.sf.json.JSONObject;

import com.powerunion.datacollection.model.MaintblData;
import com.powerunion.datacollection.model.SysServer;

public interface MaintblDataDao {
	public boolean save(MaintblData data, String formValues)
			throws DaoException;

	/**
	 * 获取指标表类型表单的主表报送区数据
	 * 
	 * @param data
	 * @return
	 * @throws DaoException
	 */
	public JSONObject getMaintblDataInfo(MaintblData data) throws DaoException;

	public List getAllMaintblDataByAct(List submissionWorks)
			throws DaoException;

	public List getMaintblFields(String formId) throws DaoException;

	/**
	 * 获取主从表类型表单的主表报送区数据
	 * 
	 * @param data
	 * @return
	 * @throws DaoException
	 */
	// public JSONObject getMaintblDataInfo4SubFormMaintTbl(MaintblData data)
	// throws DaoException;
	public boolean deleteFormData(MaintblData data, Connection conn, String sql)
			throws DaoException;

	public boolean deleteMaintblData(MaintblData data, Connection conn)
			throws DaoException;

	public boolean saveMaintblData(MaintblData data) throws DaoException;

	public String getMaintblDataByKey(MaintblData data, Connection conn)
			throws DaoException;
	/**
	 * 提供初始化的表单的外键值
	 * 用于填报人第一次填报数据的时候初始化表单
	 * @param data
	 * @param conn
	 * @return
	 * @throws DaoException
	 */
	public String getMaintblDataByKey4Init(MaintblData data, Connection conn)
			throws DaoException;
	
	public List getAllMaintblDataByAct4subTbl(List submissionWorks)
	throws DaoException;
}
